<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
	<body>
		<script type="text/javascript">

			function addOrUpdateMenu(){
				//debugger;
				//alert("aa");
				var r = $('#menuForm').form('validate');
				if(!r) {
					return false;
				}
				$.post("${pageContext.request.contextPath}/sys/menu.do?addOrUpdate",$("#menuForm").serializeArray(),function(data){
					//alert("bb");
					$('#MyPopWindow').window('close');
					$('#menuTreeGridTable').treegrid('reload');
					$.messager.alert('提示',data.msg,'info');
				});
			}
			$('#menuPopPanel').panel();
			$('#menusortid').numberbox();
		</script>
		
		<form id="menuForm" method="post" style="margin: 10;text-align: center;">
			<div id="menuPopPanel"  collapsible="true" style="padding:10px;">
				<div region="center" border="false" style="padding:10px;border:1px solid #ccc;">
					父节点：<input type="text" id="parentname" name="fathername" style="width: 200px;border: 1px solid #ccc;padding: 2px;" readonly="readonly" /><br /><br />
					<input type="hidden" id="fatherid" name="fatherid" />
					<input type="hidden" name="id" id="uuid">
					名称：<input type="text" id ="functionname" name="functionname" style="width: 200px;border: 1px solid #ccc;padding: 2px;" class="easyui-validatebox" required="true" /> <br /><br />
					图标：<input type="text" name="icon" style="width: 200px;border: 1px solid #ccc;padding: 2px;"  class="easyui-validatebox" required="false" /> <br /><br />
					地址：<input type="text" name="url" id="menuurl" style="width: 200px;border: 1px solid #ccc;padding: 2px;"   class="easyui-validatebox" required="true" /> <br /><br />
					排序：<input type="text" name="sortid" id="menusortid" style="width: 200px;border: 1px solid #ccc;padding: 2px;" type="password"   class="easyui-validatebox" required="true" /> <br /><br />
					底级：<input type="radio" name="isbottom" id="menuisbottom" value="1" checked="checked"/>是<input type="radio" name="isbottom" value="0" />否&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;
					禁用：<input type="radio" name="isdisabled" id="menuisbottom" value="1" />是<input type="radio" name="isdisabled" value="0" checked="checked" />否
					<br />
				</div>
				<div region="south" border="false" style="text-align:right;height:30px;line-height:30px;">
					<a href="#" id="btn-back" onclick="closeWindow();" class="easyui-linkbutton" iconCls="icon-back">返回</a>
					<a href="#" id="btn-add" onclick="addOrUpdateMenu();" class="easyui-linkbutton" iconCls="icon-save">保存</a>
				</div>
			</div>
		</form>
		
	</body>
</html>